<?php
namespace Home\Controller;
use Common\Controller\HomebaseController;

class ContactController extends HomebaseController {
    public function index()
    {
        $page = get_one_category(20);
        $page1 = $this->get_page(23);
        $seoTitle = "";
        if (!empty($page1['title'])) {
            $seoTitle = $page1['title'] . ' - ';
        }
        $siteOptions = get_site_options();
        $this->assign('site_seo_title', $seoTitle . $siteOptions['site_name']);
        if (!empty($page['post_keywords'])) {
            $this->assign('site_seo_keywords', $page['post_keywords']);
        }
        if (!empty($page['post_excerpt'])) {
            $this->assign('site_seo_description', $page['post_excerpt']);
        }
        $history = get_where_list('about', array('cid' => 11), 100, 'id asc,');
        $honor = get_where_list('about', array('cid' => 12), 100, 'id asc,');
        $this->assign('page', $page);
        $this->assign('page1', $page1);
        $this->assign('history', $history);
        $this->assign('honor', $honor);
        $this->display('contact');
    }

    function get_page($cid)
    {
        $where = array('cid' => $cid);
        $post = M('about')->where($where)->find();
        return $post;
    }
}